include ../config.mk

TARGET = test_queue test_sock test_mp3dec 
all: $(TARGET)

%.o : %.c
	$(CC) $(CFLAGS) -c $< -o $@ $(INCS)

test_queue: test_queue.o
	$(CC) $(CFLAGS) -o $@ $< $(INCS) $(LIBS)

test_mp3dec: test_mp3dec.o
	$(CC) $(CFLAGS) -o $@ $< $(INCS) $(LIBS)

test_sock: test_sock.o
	$(CC) $(CFLAGS) -o $@ $< $(INCS) $(LIBS)

test:
	PWD=$(shell pwd);
	for xfile in $(abspath $(TARGET)) ; \
	do \
		if [[ -x $$xfile ]] ; \
		then \
			echo $$xfile; \
			sh -c $$xfile; \
		fi \
	done 

myowntest:
	PWD=$(shell pwd);
	for xfile in $(abspath $(TARGET)) ; \
		do \
			echo $$xfile; \
	done

clean:
	rm -f ./*.o $(TARGET)
